#include "ActionEvent.h"

namespace Impp{

DEFINE_EVENT_TYPE(EVT_ACTION)

ActionEvent::ActionEvent(Action* action, const ActionEventType & actionEventType, wxEventType eventType, int id):
	wxNotifyEvent(eventType,id),
	action(action),
	actionEventType(actionEventType)
{
	this->action->lock();
}

ActionEvent::~ActionEvent()
{
	action->unLock();
}

wxEvent* ActionEvent::Clone() const
{
	this->action->lock();
	return new ActionEvent(*this);
}

ActionId ActionEvent::getActionId()
{
	return action->getId();
}

wxString ActionEvent::getActionClassName()
{
	return action->GetClassInfo()->GetClassName();
}

Action* ActionEvent::getAction(){
	return action;
}

ActionEventType ActionEvent::getActionEventType()
{
	return actionEventType;
}

}



